An Assertion Checking Wrapper Design for Java
نویسندگان
چکیده
The Java Modeling Language allows one to write formal behavioral specifications for Java classes in structured comments within the source code, and then automatically generate run-time assertion checks based on such a specification. Instead of placing the generated assertion checking code directly in the underlyling class bytecode file, placing it is a separate wrapper component offers many advantages. Checks can be distributed in binary form alongside the compiled class, and clients can selectively include or exclude checks on a per-class basis without recompilation. In this approach, when checks are excluded the underlying code is just as efficient as if assertions were “compiled out.” In addition, a flexible mechanism for enabling or disabling assertion execution on a per-class or per-package basis is also included. This paper presents a design for separating assertion checking code into wrapper classes and discusses the issues arising from this design.
منابع مشابه
JASSDA TRACE ASSERTIONS∗ Runtime Checking the Dynamic of Java Programs
Research into runtime checking of programs mainly concentrates on the Design by Contract concept, as proposed by Meyer for the programming language Eiffel. The goal is here to check whether a program fulfills certain conditions in certain states, i.e method entry and exit points. Jass (Java with assertions)[1] tries to extend this to behavioural properties by adding trace assertion for dynamica...
متن کاملHow the Design of JML Accommodates Both Runtime Assertion Checking and Formal Verification
Specifications that are used in detailed design and in the documentation of existing code are primarily written and read by programmers. However, most formal specification languages either make heavy use of symbolic mathematical operators, which discourages use by programmers, or limit assertions to expressions of the underlying programming language, which makes it difficult to write complete s...
متن کاملHow the Design of JML Accomodates Both Runtime Assertion Checking and Formal Verification
Specifications that are used in detailed design and in the documentation of existing code are primarily written and read by programmers. However, most formal specification languages either make heavy use of symbolic mathematical operators, which discourages use by programmers, or limit assertions to expressions of the underlying programming language, which makes it difficult to write complete s...
متن کاملExecuting Quantified Expressions in the JML Run
Modern software development projects are extremely complex and often involve millions of lines of code. Using the Java Modeling Language (JML) can substantially reduce bugs and errors in software implemented in Java. The JML tool from Iowa State has many features, including static checking and run-time assertion checking of preconditions. However, the runtime assertion checking lacks the abilit...
متن کاملRun-Time Assertion Checking of Data- and Protocol-Oriented Properties of Java Programs: An Industrial Case Study
Run-time assertion checking is one of the useful techniques for detecting faults, and can be applied during any program execution context, including debugging, testing, and production. In general, however, it is limited to checking state-based properties. We introduce SAGA, a general framework that provides a smooth integration of the specification and the run-time checking of both dataand prot...
متن کامل